SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE_MUTEX {IB_CPPEXTRAFLAG}")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE_MUTEX {IB_CPPEXTRAFLAG}")

SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} {IB_CPPEXTRAFLAG}")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} {IB_CPPEXTRAFLAG}")

INCLUDE_DIRECTORIES("{SOURCE_DIR}"
                    "{MYSQL_DIR}/sql"
                    "{MYSQL_DIR}/regex"
                    "{MYSQL_DIR}/include"
                    "{MYSQL_DIR}/extra/yassl/include"
                    "{MYSQL_DIR}/extra/yassl/taocrypt/include"
				            "{SOURCE_DIR}/{EDITION}"
                    "{BOOST_DIR}")

file( GLOB VC_SRCS "{SOURCE_DIR}/vc/*.cpp" )
file( GLOB VC_HDRS "{SOURCE_DIR}/vc/*.h" )
file( GLOB VC_SRCS_EDITION "{SOURCE_DIR}/{EDITION}/edition/vc/*.cpp" )
file( GLOB VC_HDRS_EDITION "{SOURCE_DIR}/{EDITION}/edition/vc/*.h" )
ADD_LIBRARY(bh-vc ${VC_SRCS} ${VC_HDRS} ${VC_SRCS_EDITION} ${VC_HDRS_EDITION})
add_dependencies( bh-vc GenError )

set( WITH_EMBEDDED {withEmbedded} )

if ( WITH_EMBEDDED )
ADD_LIBRARY(bh-vc-embedded ${VC_SRCS} ${VC_HDRS} ${VC_SRCS_EDITION} ${VC_HDRS_EDITION})
add_dependencies( bh-vc-embedded GenError )
set_target_properties(bh-vc-embedded PROPERTIES COMPILE_DEFINITIONS EMBEDDED_LIBRARY)
endif()


set( WITH_DATAPROCESSOR {withDataprocessor} )

if ( WITH_DATAPROCESSOR )
ADD_LIBRARY(bh-vc-pure ${VC_SRCS} ${VC_HDRS} ${VC_SRCS_EDITION} ${VC_HDRS_EDITION})
add_dependencies( bh-vc-pure GenError )
set_target_properties(bh-vc-pure PROPERTIES COMPILE_DEFINITIONS PURE_LIBRARY)
endif()

# vim: ft=cmake
